package com.lcb.jmm.unsafe;

import com.lcb.jmm.volatiledome.UnsafeInstance;

/****
 * @Author:刘长柏
 * @Date: 2021-01-05 15:32
 * @Description:内存屏障
 *****/
public class FenceTest {
    public static void main(String[] args) {

        //读屏障
        UnsafeInstance.reflectGetUnsafe().loadFence();

        //写屏障
        UnsafeInstance.reflectGetUnsafe().storeFence();

        //读写屏障
        UnsafeInstance.reflectGetUnsafe().fullFence();

    }
}
